function AA = unmerge_fringe(A, D_major, arg_share, D_nF, N_st)

ncol = size(A,2);

A_m = A(D_major==1,:); % N.ist-N_st x ncol
A_f = A(D_major==0,:); % N_st x ncol

% adjust when A contains mkt share data
if arg_share==1 
    A_f_single = A_f./repmat(D_nF, 1, ncol); % N_st x ncol
else
    A_f_single = A_f; 
end

% stack 
A_f_all = [];
for mm=1:N_st 
    A_f_single_mm = A_f_single(mm,:);
    A_f_all = [A_f_all; repmat(A_f_single_mm, D_nF(mm), 1)];
end

AA = [A_m; A_f_all];